main(n,y)
{
	double x,r;
	for(gets(&n);~scanf("%d",&n);printf("%.2lf\n",r))
		for(r=1;n--;r*=pow(x,y))
			scanf("%lf%d",&x,&y);
}
